home *** CD-ROM | disk | FTP | other *** search
- Path: merlin.dclf.npl.co.uk!jrs
- From: jrs@dclf.npl.co.uk (Dr John Stockton NPL UK)
- Newsgroups: comp.lang.c,comp.lang.c++,comp.os.ms-windows.programmer.misc,comp.os.msdos.programmer,comp.programming,comp.windows.ms.programmer
- Subject: Re: Date Arithmetic
- Date: Wed, 21 Feb 1996 10:27:10
- Organization: National Physical Laboratory UK
- Message-ID: <jrs.2754.000A7444@dclf.npl.co.uk>
- References: <4g19kp$640@tracy.protocom.com>
- NNTP-Posting-Host: merlin.dclf.npl.co.uk
- X-Newsreader: Trumpet for Windows [Version 1.0 Rev A]
-
- In article <4g19kp$640@tracy.protocom.com> "Michael J. Karas" <mkaras@pclink.com> writes:
-
- >I am working on an algorithm for a laser marking machine that writes
- >expiration delays on to food product boxes. The algorithm needs to
- >be able to add NNN days to todays date in the fastest manner possible
- >without using any floating point arithmetic. I could use help from anyone
- >that has C code for doing this. It would be nice if the solution took the
- >leap year problem in to account including the special case of the year
- >2000. Thanks in advance to anyone who could share their knowledge on this
- >subject.
-
- In practice, 2000 is not special. The 100 year & 400 year rules cancel.
- Every fourth year from 1901 to 2099 is leap.
- --
- John Stockton : mailto:JRS@dclf.npl.co.uk from off-site. MIME. WP.
- National Physical Laboratory, Teddington, Middlesex, TW11 0LW, UK
- Direct Telephone +44 181-943 6087, Nearby Fax +44 181-943 7138
- Offshore news still takes up to a week to get here; please
- E-mail me a copy of non-UK non-pascal non-TV followups !
- Regret system puts unzoned (UK civil) time on messages.
-